package com.crm.service.impl.sys.permissionManagement;

import com.crm.dao.mapper.customMapper.sys.IssueInvoiceCustomMapper;
import com.crm.dao.mapper.sys.permissionManagement.SysIssueInvoiceMapper;
import com.crm.model.entity.sys.permissionManagement.SysIssueInvoice;
import com.crm.model.vo.sys.IssueInvoiceVO;
import com.crm.service.sys.permissionManagement.IssueInvoiceDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:chaifuyou
 * @Date: 2021/7/22 13:59
 */
@Service
public class IssueInvoiceDbServiceImpl implements IssueInvoiceDbService {

    @Autowired
    private IssueInvoiceCustomMapper issueInvoiceCustomMapper;

    @Autowired
    private SysIssueInvoiceMapper sysIssueInvoiceMapper;

    /**
     * 查询分公司开票列表
     * @param companyName
     * @return
     */
    @Override
    public List<IssueInvoiceVO> selectIssueInvoiceList(String companyName) {
        return issueInvoiceCustomMapper.selectIssueInvoiceList(companyName);
    }

    /**
     * 增加分公司开票公司
     * @param sysIssueInvoice
     */
    @Override
    public void addCompanyIssueInvoice(SysIssueInvoice sysIssueInvoice) {
        sysIssueInvoiceMapper.insertSelective(sysIssueInvoice);
    }

    /**
     * 删除分公司开票信息
     * @param companyId
     */
    @Override
    public void delCompanyIssueInvoice(String companyId) {
        issueInvoiceCustomMapper.delCompanyIssueInvoice(companyId);
    }

    /**
     * 删除开票信息
     * @param issueInvoiceId
     */
    @Override
    public void delIssueInvoice(String issueInvoiceId) {
        issueInvoiceCustomMapper.delIssueInvoice(issueInvoiceId);
    }

    /**
     * 根据分公司查询开票公司列表
     * @param companyId
     * @return
     */
    @Override
    public List<IssueInvoiceVO> selectInvoiceCompanyList(String companyId) {
        return issueInvoiceCustomMapper.selectInvoiceCompanyList(companyId);
    }
}
